
import java.security.InvalidParameterException;
import java.util.Vector;

public class GameStatistics {
	
	private Vector<PlayerData> roundData = new Vector<PlayerData>();

	private static GameStatistics gs = null;
	
	public static synchronized GameStatistics getStats(){
		if(gs == null){
			gs = new GameStatistics();
		}
		return gs;
	}
	
	private GameStatistics(){
		for(int i = 0; i < 6; i++){
			roundData.add(new PlayerData());
		}
	}
	
	public Vector<PlayerData> getAllStats(){
		return roundData;
	}
	
	public PlayerData getPlayerStats(int player){
		if(player < 0 || player > 6){
			System.err.println("GameStatistics::getPlayerStats -> Invalid parameter.");
			throw new InvalidParameterException();
		}else{
			return roundData.get(player -1);
		}
	}
}
